<template>
  <div class="personal-main">
    <div class="personal-money">
      <h3><i>投资记录</i></h3>

      <div class="personal-moneylist" style="margin-top: 40px;">
        <div class="pmain-contitle">
          <span class="pmain-title1 fb" style="width: 180px;">
            投资编号
          </span>
          <span class="pmain-title2 fb" style="width: 100px;">
            投资金额
          </span>
          <span class="pmain-title2 fb" style="width: 180px;">
            投资时间
          </span>
          <span class="pmain-title2 fb" style="width: 100px;">
            预计收益
          </span>
          <span class="pmain-title2 fb" style="width: 120px;">
            实际收益
          </span>
          <span class="pmain-title1 fb" style="width: 100px;">
            状态
          </span>
        </div>
        <ul>
          <li
              v-for="lendItem in lendItemList"
              :key="lendItem.id"
              style="width:100%"
          >
            <span class="pmain-title1 pmain-height" style="width: 160px;">
            {{ lendItem.lendItemNo }}
          </span>
            <span class="pmain-title1 pmain-height" style="width: 70px;">
            {{ lendItem.investAmount }}
          </span>
            <span class="pmain-title1 pmain-height" style="width: 160px;">
            {{ lendItem.investTime }}
          </span>
            <span class="pmain-title1 pmain-height" style="width: 100px;">
            {{ lendItem.expectAmount }}
          </span>
            <span class="pmain-title1 pmain-height" style="width: 90px;">
            {{ lendItem.realAmount }}
          </span>
            <span class="pmain-title1 pmain-height" style="width: 100px;">
              <span v-if="lendItem.status === '0'">
                        默认
              </span>
              <span v-if="lendItem.status === '1'">
                        已支付
              </span>
              <span v-else>已还款</span>
          </span>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      lendItemList: [],
    }
  },

  created() {
    this.fetchLendItemList()
  },

  methods: {
    fetchLendItemList() {
      this.$axios.$get('/api/core/lendItem/list').then((response) => {
        this.lendItemList = response.data.list
      })
    },
  },
}
</script>
